package com.firewolf.entities.n2n;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class MainDriver {
	
	private EntityManagerFactory factory = null;
	private EntityManager manager = null;
	private EntityTransaction tx = null;
	
	@Before
	public void init(){
		factory = Persistence.createEntityManagerFactory("jpa");
		manager = factory.createEntityManager();
		tx = manager.getTransaction();
		tx.begin();
	}
	
	@After
	public void destory(){
		tx.commit();
		manager.close();
		factory.close();
	}
	
	/**
	 * 生成表
	 */
	@Test
	public void generateTable(){
	}
	
}
